package com.yj.ccs.abs.common.model;

import lombok.Data;

import java.io.Serializable;

/**
 * Copyright 2018 (C) Yunjian-VC
 * Created on : 2018/3/14
 * Author     : Unbelievable9
 **/
@Data
public class BaseResult implements Serializable {

    private static final long serialVersionUID = 1L;

    private Boolean success;

    private String message;

    private Object data;

    private BaseResult setSucess(Boolean success) {
        this.success = success;

        return this;
    }

    private BaseResult setMessage(String message) {
        this.message = message;

        return this;
    }

    public BaseResult setData(Object data) {
        this.data = data;

        return this;
    }

    public static BaseResult success(String message) {
        return new BaseResult().setSucess(true).setMessage(message);
    }

    public static BaseResult error(String message) {
        return new BaseResult().setSucess(false).setMessage(message);
    }
}
